Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: fix coverage report when --enable-source-maps is provided #55228

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

geeksilva97
Copy link
Contributor

@geeksilva97 geeksilva97 commented Oct 1, 2024

Refs: #55106 #54753

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Oct 1, 2024
@RedYetiDev
Copy link
Member

I bring with me my concerns from the other PR, but I'm curious what others think

@geeksilva97 geeksilva97 changed the title Issue 55106 test_runner: fix coverage report when --enable-source-maps is provide Oct 1, 2024
@geeksilva97 geeksilva97 changed the title test_runner: fix coverage report when --enable-source-maps is provide test_runner: fix coverage report when --enable-source-maps is provided Oct 1, 2024
@geeksilva97
Copy link
Contributor Author

I bring with me my concerns from the other PR, but I'm curious what others think

Now I see what you meant. I will dig into it.

Copy link

codecov bot commented Oct 5, 2024

Codecov Report

Attention: Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.

Project coverage is 88.40%. Comparing base (deb5eff) to head (6391e6e).
Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/test_runner/coverage.js 44.44% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55228      +/-   ##
==========================================
- Coverage   88.41%   88.40%   -0.02%     
==========================================
  Files         652      652              
  Lines      186756   186785      +29     
  Branches    36100    36101       +1     
==========================================
- Hits       165126   165119       -7     
- Misses      14906    14931      +25     
- Partials     6724     6735      +11     
Files with missing lines Coverage Δ
lib/internal/test_runner/coverage.js 63.82% <44.44%> (-0.83%) ⬇️

... and 33 files with indirect coverage changes

@geeksilva97
Copy link
Contributor Author

Codecov Report

Attention: Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.

Project coverage is 88.40%. Comparing base (98788da) to head (c0deb06).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/test_runner/coverage.js 44.44% 15 Missing ⚠️
Additional details and impacted files

@@            Coverage Diff             @@
##             main   #55228      +/-   ##
==========================================
+ Coverage   87.89%   88.40%   +0.51%     
==========================================
  Files         652      652              
  Lines      186589   186638      +49     
  Branches    35750    36054     +304     
==========================================
+ Hits       163999   165003    +1004     
+ Misses      15816    14904     -912     
+ Partials     6774     6731      -43     

Files with missing lines Coverage Δ
lib/internal/test_runner/coverage.js 63.86% <44.44%> (-0.83%) ⬇️
... and 96 files with indirect coverage changes

how's this possible?

@RedYetiDev
Copy link
Member

how's this possible?

In my experience, codecov isn't always exactly accurate. Regardless, it's nothing to be concerned about.

@RedYetiDev RedYetiDev added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Oct 6, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 6, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@geeksilva97
Copy link
Contributor Author

geeksilva97 commented Oct 7, 2024

Test is failing with

✖ should throw when a source map is not valid JSON (73.0115ms)
  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

    t.assert.ok(spawned.stdout.includes(error))

      at TestContext.<anonymous> (/Users/edysilva/projects/contributions/node/test/parallel/test-runner-coverage-source-map.js:118:16)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async Test.run (node:internal/test_runner/test:935:9)
      at async Suite.processPendingSubtests (node:internal/test_runner/test:633:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: false,
    expected: true,
    operator: '=='
  }

test at test/parallel/test-runner-coverage-source-map.js:113:11

would you have any clue @RedYetiDev ? Looks like tests are somehow interfering with each other. If I execute this ^ isolatedly it works. Thanks in advance.

EDIT: on CI, mine fails. Not sure what caused that.

@RedYetiDev
Copy link
Member

EDIT: on CI, mine fails. Not sure what caused that.

If you can reproduce the failure locally, it might help to have it log the output to see what the actual difference is.

@geeksilva97
Copy link
Contributor Author

geeksilva97 commented Oct 7, 2024

EDIT: on CI, mine fails. Not sure what caused that.

If you can reproduce the failure locally, it might help to have it log the output to see what the actual difference is.

It's the assertion on stdout

TAP version 13
# Subtest: /Users/edysilva/projects/contributions/node/test/fixtures/test-runner/source-maps/invalid-json/index.js
ok 1 - /Users/edysilva/projects/contributions/node/test/fixtures/test-runner/source-maps/invalid-json/index.js
  ---
  duration_ms: 38.544167
  ...
1..1
# Warning: Could not report code coverage. TypeError: Cannot read properties of null (reading 'sourcesContent')
# tests 1
# suites 0
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 43.42

this message is not being printed.


When I run ./node --test --experimental-test-coverage --test-reporter tap test/fixtures/test-runner/source-maps/missing-sources/index.js it prints the message though.

TAP version 13
# Subtest: test/fixtures/test-runner/source-maps/missing-sources/index.js
ok 1 - test/fixtures/test-runner/source-maps/missing-sources/index.js
  ---
  duration_ms: 301.77525
  ...
1..1
# Warning: Could not report code coverage. Error [ERR_SOURCE_MAP_MISSING_SOURCE]: Cannot find 'file:///Users/edysilva/projects/contributions/node/test/fixtures/test-runner/source-maps/missing-sources/nonexistent.js' imported from the source map for 'file:///Users/edysilva/projects/contributions/node/test/fixtures/test-runner/source-maps/missing-sources/index.js'
# tests 1
# suites 0
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 305.851208

Sorry @RedYetiDev . Newbie working. I think I need to recompile

@RedYetiDev
Copy link
Member

Try rebasing to include your other PR?

@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 8, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 8, 2024
@nodejs-github-bot
Copy link
Collaborator

@atlowChemi atlowChemi added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 8, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 8, 2024
@nodejs-github-bot nodejs-github-bot merged commit 3a42085 into nodejs:main Oct 8, 2024
59 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 3a42085

@cjihrig
Copy link
Contributor

cjihrig commented Oct 8, 2024

This Refs two issues. Does it actually fix either/both of them?

@geeksilva97
Copy link
Contributor Author

geeksilva97 commented Oct 8, 2024

This Refs two issues. Does it actually fix either/both of them?

I'd say yes. I'm pretty sure it solves #54753. Could you confirm for #55106 @RedYetiDev ?

@RedYetiDev
Copy link
Member

RedYetiDev commented Oct 8, 2024

There aren't any tests to confirm that, can you no longer reproduce the errors described? I would assume your other PR fixes that one

aduh95 pushed a commit that referenced this pull request Oct 9, 2024
PR-URL: #55228
Refs: #55106
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
@aduh95 aduh95 mentioned this pull request Oct 9, 2024
@aduh95 aduh95 added dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Oct 9, 2024
@RedYetiDev RedYetiDev added dont-land-on-v23.x PRs that should not land on the v23.x-staging branch and should not be released in v23.x. and removed dont-land-on-v23.x PRs that should not land on the v23.x-staging branch and should not be released in v23.x. labels Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants